<div class="isi">
        
        <?php 
			$m_katagori = new M_katagori();
			$list = $m_katagori->get_where(array('parentid' => 0));
            $atr=array('id'=>'formID',
                    'class'=>'formular');
            echo form_open('admin_katagori/simpan', $atr);
        ?> 
            <input type="hidden" size="10" name="id" id="id"  value="<?php echo $id ?>" />
            <table width="100%" >
                <tr>
                    <td width="15%"><p> Kode Katagori </p> </td>
                    <td><p> : </p> </td>
                    <td> <input type="text" size="10" name="kode_katagori" id="kode_katagori" class="validate[required,minSize[5], maxSize[5]] text-input" value="<?php echo $kode_katagori ?>" /> </td>
                </tr>            
                <tr>
                    <td width="15%"><p> Nama Katagori </p> </td>
                    <td><p> : </p> </td>
                    <td> <input type="text" size="70" name="nama_katagori" id="nama_katagori" class="validate[required] text-input" value="<?php echo $nama_katagori ?>"/> </td>
                </tr>
				 <tr>
                    <td width="15%"><p> Parent Katagori </p> </td>
                    <td><p> : </p> </td>
                    <td> 
						<select name="parent_katagori" id="parent_katagori" class="validate[required] text-input" />
							<option value="0">No Parent</option>
						<?php 
							if($child_katagori == 0){
								foreach ($list as $row) {
									if($parent_katagori == $row->id){
										echo "<option selected='selected' value='$row->id'>$row->nama_katagori</option>";
									} else {
										echo "<option value='$row->id'>$row->nama_katagori</option>";
									}
								}
							}
						?>
						</select>
					</td>
                </tr>
            </table>
            <br/>
            <?php  echo anchor("admin_katagori","Kembali","class='button' style='color:#f8f8f8'") ?>
            <input type="submit" value="         Simpan       " class="button"/>
            <div class="clear"></div>
    
        </form>
   
</div>